package com.e3.basdoc.cust.client;

import com.e3.basdoc.cust.model.CustModel;
import com.e3.template.tgf.TGFEditorDialog;
import com.e3.template.tgf.TGFFormPanel;
import com.e3.web.core.client.GwtAsyncCallback;
import com.google.gwt.user.client.Element;

public class CustEditorDialog extends TGFEditorDialog<CustModel> {

	private CustRPCServiceAsync service = CustRPCService.Util.getInstance();
	
	@Override
	protected void onRender(Element parent, int pos) {
		super.onRender(parent, pos);
		this.setSize(600, 550);
	}

	@Override
	public TGFFormPanel<CustModel> createFormPanel() {
		return new CustFormPanel();
	}

	@Override
	public void executeNewService(CustModel model,GwtAsyncCallback<CustModel> callback) {
		service.newCust(model, callback);
	}

	@Override
	public void executeModifyService(CustModel model,GwtAsyncCallback<CustModel> callback) {
		service.modifyCust(model, callback);
	}

	@Override
	public String[] getNotNullFieldNames() {
		return CustHelper.INSTANCE.getNotNullFieldNames();
	}

}
